<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>后盾人</title>
  </head>
  <body>
    
  </body>
  <script>
    let symbol = Symbol("Symbol类型");
    let hd = {
      name: "后盾人",
      [symbol]: "houdunren.com"
    };
    // for (const key in hd) {
    //   console.log(key);
    // }
    // for (const key of Object.getOwnPropertySymbols(hd)) {
    //   console.log(key);
    // }
    // for (const key of Reflect.ownKeys(hd)) {
    //   console.log(key);
    // }
    let site = Symbol("这是一个Symbol");
    class User {
      constructor(name) {
        this.name = name;
        this[site] = "后盾人";
      }
      getName() {
        return `${this[site]} ${this.name}`;
      }
    }
    let lisi = new User("李四");
    // console.log(lisi.getName());
    for (const key in lisi) {
      console.log(key);
    }
    
  </script>
</html>
